// pages/collect/collect.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
    tabs: [
      { id: 1, value: "商品收藏", isActive: true },
      { id: 2, value: "品牌收藏", isActive: false },
      { id: 3, value: "店铺收藏", isActive: false },
      { id: 4, value: "浏览足迹", isActive: false },
    ],
    collect: [],
  },
  tabClickChange(e) {
    // 当前点击
    let { detail } = e,
      { tabs } = this.data;
    tabs.forEach((item) =>
      item.id == detail ? (item.isActive = true) : (item.isActive = false)
    );
    this.setData({
      tabs
    });
  },
  onShow(e) {
    let pages = getCurrentPages(),
       nowPages = pages[pages.length - 1],
       type = nowPages.options.type
       console.log(type);
    let user = wx.getStorageSync("user")||{}
    let {collectionList} = user
    console.log(collectionList)
    this.setData({
      collect: collectionList
    })
  },
});
